#include "Heater.h"
#include "DSP2833x_Device.h"

bool Heater::Init()
{
	// Configure GPIO32 as a GPIO output pin
	EALLOW;
	GpioCtrlRegs.GPAMUX1.bit.GPIO7 = 0;
	GpioCtrlRegs.GPADIR.bit.GPIO7 = 1;
 	EDIS;
 	
 	Reset();
 	
	return true;
}

void Heater::Set()
{
	m_Active = true;
	GpioDataRegs.GPASET.bit.GPIO7 = 1;
}

void Heater::Reset()
{
	m_Active = false;
	GpioDataRegs.GPACLEAR.bit.GPIO7 = 1;
}

void Heater::Toggle()
{
	m_Active = !m_Active;
	GpioDataRegs.GPATOGGLE.bit.GPIO7 = 1;
}

bool Heater::IsON()
{
	return m_Active;
}
